package com.neo.impatient.C03_array.C03_03_foreachArray

import scala.collection.mutable.ArrayBuffer

object ForeachArray {


  def main(args: Array[String]): Unit = {

    val a = new ArrayBuffer[Int]

    a +=(5,6,7)
    println(a)


    println("下标方式")
    for(i <- a.indices)
      println(a(i))

    println("直接访问元素")
    for(i <- a)
      println(i)

  }
}
